package com.guchenbo.example.io;

import cn.hutool.core.io.FileUtil;
import com.alibaba.fastjson.JSON;

import java.nio.charset.Charset;
import java.util.List;

/**
 * @author guchenbo
 * @date 2022/4/30
 */
public class BookUtils {

    public static List<String> getBooks(){
        String book = FileUtil.readString("books.json", Charset.defaultCharset());
        return JSON.parseArray(book).toJavaList(String.class);
    }
}
